package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.station.dto.ShiftClassDto;
import com.shensi.api.admin.domian.station.dto.StaffForm;
import com.shensi.api.admin.domian.station.dto.StaffVO;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface ShiftClient {

    @GetMapping("/staff/query")
    public TableDataInfo queryList(@SpringQueryMap StaffForm form);

    @PostMapping("/staff/insert")
    public AjaxResult insert(@RequestBody StaffVO form);

    @PostMapping("/staff/update")
    public AjaxResult update(@RequestBody StaffVO form);

    @GetMapping("/staff/getById")
    public AjaxResult getById(@RequestParam("id") Long id);

    @DeleteMapping("/staff/delete")
    public AjaxResult delete(@RequestParam("ids") Long[] ids);

    @GetMapping("/staff/queryGunList")
    public AjaxResult queryStationGunList(@RequestParam(value = "stationId") @Validated @NotNull Long stationId);


    @GetMapping("/staff/getUserPermissions")
    public AjaxResult getUserPermissions(@RequestParam(value = "userId") Long userId);

    /**判断用户是否是员工*/
    @GetMapping("/staff/employeeSign")
    public AjaxResult getEmployeeSign();
}
